     /* 部门接口 */
import request from '@/utils/request'

/**
 *  查询部门列表，获取组织架构数据
 * @returns
 */
export function getDepartmentList() {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

/**
 *   根据id删除部门
 * @param {*} 部门的id
 * @returns
 */
export function delDepartment(id) {
  return request({
    method: 'DELETE',
    url: '/company/department/' + id
  })
}

/**
 *   新增部门
 * @param {*} data
 * @returns
 */
export function addDepartment(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}
/**
 *   根据id修改部门详情
 * @param {*} id
 * @returns
 */
export function getDepartDetail(id) {
  return request({
    method: 'get',
    url: '/company/department/' + id
  })
}
/**
 *  根据id修改部门详情
 * @param {*} data
 * @returns
 */
export function updateDepartment(data) {
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}

